// 去除匹配字符串两端的特定字符
function trimSpecificChars(str, chars) {
  chars.forEach((char) => {
    const regex = new RegExp(`^[${char}]+|[${char}]+$`, "g");
    str = str.replace(regex, "");
  });
  return str;
}

function isNumeric(str) {
  if (typeof str != "string") return false; // we only process strings!
  const num = Number(str);
  return !Number.isNaN(num) && Number.isFinite(num);
}


export { trimSpecificChars, isNumeric };